'use strict';

module.exports = app => {
  const { router, controller: { lease }, middleware: { checkPageTable, checkParams } } = app;

  const baseUrl = '/api/lease';
  router.get(baseUrl + '/my', checkPageTable(), lease.indexMy);
  router.get(baseUrl + '/fromMy', checkPageTable(), lease.indexFromMy);
  router.get(baseUrl, checkPageTable(), lease.index);
  router.get(baseUrl + '/:id', checkParams(), lease.show);
};
